package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 新增套餐时,需要把新增套餐的菜品插入到套餐菜品关系表中
     * @param setmealDishes
     */
    void saveSetMealWithDish(List<SetmealDish> setmealDishes);

    /**
     * 根据ids集合批量删除套餐
     * @param ids
     */
    void delSetmealDishByIds(List<Long> ids);

    @Select("Select * from setmeal_dish where setmeal_id=#{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);

    @Delete("delete from setmeal_dish where setmeal_id=#{setmealId}")
    void delSetmealDish(Long setmealId);


}
